<template>
    <div class="box2">
        <h2>王玺的About组件</h2>
        <router-link to="/about/tab1">tab1</router-link>
        <router-link to="/about/tab2">tab2</router-link>
        <hr/>
        <router-view></router-view>
    </div>
</template>

<script setup>
import { watch } from 'vue';
import { useRoute } from 'vue-router';
const route=useRoute();
watch(()=>route.path,(path)=>{
    console.log("路由的路径是：",path);
});
</script>
<style scoped>
.box2{
    height: 300px;
    background-color: rgb(4, 253, 87);
    padding: 20px;
}
.box2{
    text-decoration: none;
    margin-left: 20px;
}
</style>